﻿using Microsoft.EntityFrameworkCore;

namespace CommonUtils
{
    public static class EfUtil
    {
        public static DbContextOptions GetMySqlOptions(string connectString)
        {
            var optionsBuilder = new DbContextOptionsBuilder();
            optionsBuilder.UseMySql(connectString, ServerVersion.AutoDetect(connectString));
            return optionsBuilder.Options;
        }

        public static DbContextOptions GetSqliteOptions(string connectString)
        {
            var optionsBuilder = new DbContextOptionsBuilder();
            optionsBuilder.UseSqlite(connectString);
            return optionsBuilder.Options;
        }

        public static DbContextOptions GetSqlServerOptions(string connectString)
        {
            var optionsBuilder = new DbContextOptionsBuilder();
            optionsBuilder.UseSqlServer(connectString);
            return optionsBuilder.Options;
        }
    }
}
